]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/keyboard: Track ::layout-layout-group-changed for changes
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 30 Sep 2025 14:09:47 +0000 (16:09 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 8 Oct 2025 12:41:25 +0000 (12:41 +0000)
This may happen under the hood without UI interaction through modifiers
expressed in xkb-options to switch to specific layouts. Make this
actually have an effect in the UI bits, and update the selected layout
if these changes happen without further GNOME Shell involvement.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3895>

js/ui/status/keyboard.js

index c4779d4eba65fa7f13cead7e32c2668628088ece..62f1e731db30aec021c6351aa279d4a00aed12dd 100644 (file)
@@ -380,6 +380,7 @@ export class InputSourceManager extends Signals.EventEmitter {
         this._ibusManager.connect('set-content-type', this._ibusSetContentType.bind(this));
 
         global.display.connect('modifiers-accelerator-activated', this._modifiersSwitcher.bind(this));
+        global.backend.connect('keymap-layout-group-changed', this._layoutGroupChanged.bind(this));
 
         this._sourcesPerWindow = false;
         this._focusWindowNotifyId = 0;
@@ -428,6 +429,12 @@ export class InputSourceManager extends Signals.EventEmitter {
         return true;
     }
 
+    _layoutGroupChanged(backend, idx) {
+        const is = this._inputSources[idx];
+        this._currentInputSourceChanged(is);
+        this._keyboardManager.apply(is.xkbId);
+    }
+
     _switchInputSource(display, window, event, binding) {
         if (this._mruSources.length < 2)
             return;